module mirdefine;

import allegro5.allegro;


/******************************************************************************************************************
    #1. File Names
*******************************************************************************************************************/
const MESSAGE_DLL_1 = ".\\Mirmg.dll";
const MIR2_PATCH_FILE_NAME = ".\\Mir2Patch.exe";




/******************************************************************************************************************
    #1. Procedeure Define
*******************************************************************************************************************/
const _LOGIN_PROC = 0;
const _SVR_SEL_PROC = 1;
const _CHAR_SEL_PROC = 2;
const _GAME_PROC = 3;





/******************************************************************************************************************
    #1. Mouse Wheel Define
*******************************************************************************************************************/
//#ifndef WM_MOUSEWHEEL
//const WM_MOUSEWHEEL                     = WM_MOUSELAST+1;
//#endif





/******************************************************************************************************************
    #1. User Define Message
*******************************************************************************************************************/
//const _WM_USER_MSG_INPUTTED             = WM_USER + 1005;             // ¿¡µðÆ®¹Ú½º ÀÔ·Â¸Þ½ÃÁö. ¸Þ½ÃÁö°¡ Ä¿¸ÇµåÀÏ°æ¿ì wParam°ªÀº TRUE·Î ¼¼ÆÃµÈ´Ù.
//const ID_SOCKCLIENT_EVENT_MSG           = WM_USER + 1000;             // ¼ÒÄÏÀÌº¥Æ®¸Þ½ÃÁö.





/******************************************************************************************************************
    #1. Image Define Message
*******************************************************************************************************************/
/+
const _IMAGE_TILES                      = 0;
const _IMAGE_TILES30                    = 1;
const _IMAGE_TILES5                     = 2;
const _IMAGE_SMTILES                    = 3;
const _IMAGE_HOUSES                     = 4;
const _IMAGE_CLIFFS                     = 5;
const _IMAGE_DUNGEONS                   = 6;
const _IMAGE_INNERS                     = 7;
const _IMAGE_FUNITURES                  = 8;
const _IMAGE_WALLS                      = 9;
const _IMAGE_SMOBJECTS                  = 10;
const _IMAGE_ANIMATIONS                 = 11;
const _IMAGE_OBJECT1                    = 12;
const _IMAGE_OBJECT2                    = 13;
const _IMAGE_INTER                      = 14;
const _IMAGE_M_HUMAN                    = 15;
const _IMAGE_M_HAIR                     = 16;
const _IMAGE_M_WEAPON1                  = 17;
const _IMAGE_M_WEAPON2                  = 18;
const _IMAGE_M_WEAPON3                  = 19;
const _IMAGE_M_WEAPON4                  = 20;
const _IMAGE_WM_HUMAN                   = 21;
const _IMAGE_WM_HAIR                    = 22;
const _IMAGE_WM_WEAPON1                 = 23;
const _IMAGE_WM_WEAPON2                 = 24;
const _IMAGE_WM_WEAPON3                 = 25;
const _IMAGE_WM_WEAPON4                 = 26;
const _IMAGE_MAGIC                      = 27;
const _IMAGE_ITEM_INVENTORY             = 28;
const _IMAGE_ITEM_EQUIP                 = 29;
const _IMAGE_ITEM_GROUND                = 30;
const _IMAGE_MICON                      = 31;
const _IMAGE_PROGUSE                    = 32;
const _IMAGE_HORSE                      = 33;
const _IMAGE_MONSTER1                   = 34;
const _IMAGE_MONSTER2                   = 35;
const _IMAGE_MONSTER3                   = 36;
const _IMAGE_MONSTER4                   = 37;
const _IMAGE_MONSTER5                   = 38;
const _IMAGE_MONSTER6                   = 39;
const _IMAGE_MONSTER7                   = 40;
const _IMAGE_MONSTER8                   = 41;
const _IMAGE_MONSTER9                   = 42;
const _IMAGE_MONSTER10                  = 43;
const _IMAGE_MONSTER11                  = 44;
const _IMAGE_MONSTER12                  = 45;
const _IMAGE_SMONSTER1                  = 46;
const _IMAGE_SMONSTER2                  = 47;
const _IMAGE_SMONSTER3                  = 48;
const _IMAGE_SMONSTER4                  = 49;
const _IMAGE_SMONSTER5                  = 50;
const _IMAGE_SMONSTER6                  = 51;
const _IMAGE_SMONSTER7                  = 52;   
const _IMAGE_SMONSTER8                  = 53;
const _IMAGE_SMONSTER9                  = 54;
const _IMAGE_SMONSTER10                 = 55;   
const _IMAGE_SMONSTER11                 = 56;
const _IMAGE_SMONSTER12                 = 57;
const _IMAGE_NPC                        = 58;
const _IMAGE_MONMAGIC                   = 59;
const _IMAGE_INTEREX                    = 60;
+/

const _IMAGE_TILES = 0;
const _IMAGE_TILES30 = 1;
const _IMAGE_TILES5 = 2;
const _IMAGE_SMTILES = 3;
const _IMAGE_HOUSES = 4;
const _IMAGE_CLIFFS = 5;
const _IMAGE_DUNGEONS = 6;
const _IMAGE_INNERS = 7;
const _IMAGE_FUNITURES = 8;
const _IMAGE_WALLS = 9;
const _IMAGE_SMOBJECTS = 10;
const _IMAGE_ANIMATIONS = 11;
const _IMAGE_OBJECT1 = 12;
const _IMAGE_OBJECT2 = 13;

const _IMAGE_WOOD_TILES = 15;
const _IMAGE_WOOD_TILES30 = 16;
const _IMAGE_WOOD_TILES5 = 17;
const _IMAGE_WOOD_SMTILES = 18;
const _IMAGE_WOOD_HOUSES = 19;
const _IMAGE_WOOD_CLIFFS = 20;
const _IMAGE_WOOD_DUNGEONS = 21;
const _IMAGE_WOOD_INNERS = 22;
const _IMAGE_WOOD_FUNITURES = 23;
const _IMAGE_WOOD_WALLS = 24;
const _IMAGE_WOOD_SMOBJECTS = 25;
const _IMAGE_WOOD_ANIMATIONS = 26;
const _IMAGE_WOOD_OBJECT1 = 27;
const _IMAGE_WOOD_OBJECT2 = 28;

const _IMAGE_SAND_TILES = 30;
const _IMAGE_SAND_TILES30 = 31;
const _IMAGE_SAND_TILES5 = 32;
const _IMAGE_SAND_SMTILES = 33;
const _IMAGE_SAND_HOUSES = 34;
const _IMAGE_SAND_CLIFFS = 35;
const _IMAGE_SAND_DUNGEONS = 36;
const _IMAGE_SAND_INNERS = 37;
const _IMAGE_SAND_FUNITURES = 38;
const _IMAGE_SAND_WALLS = 39;
const _IMAGE_SAND_SMOBJECTS = 40;
const _IMAGE_SAND_ANIMATIONS = 41;
const _IMAGE_SAND_OBJECT1 = 42;
const _IMAGE_SAND_OBJECT2 = 43;

const _IMAGE_SNOW_TILES = 45;
const _IMAGE_SNOW_TILES30 = 46;
const _IMAGE_SNOW_TILES5 = 47;
const _IMAGE_SNOW_SMTILES = 48;
const _IMAGE_SNOW_HOUSES = 49;
const _IMAGE_SNOW_CLIFFS = 50;
const _IMAGE_SNOW_DUNGEONS = 51;
const _IMAGE_SNOW_INNERS = 52;
const _IMAGE_SNOW_FUNITURES = 53;
const _IMAGE_SNOW_WALLS = 54;
const _IMAGE_SNOW_SMOBJECTS = 55;
const _IMAGE_SNOW_ANIMATIONS = 56;
const _IMAGE_SNOW_OBJECT1 = 57;
const _IMAGE_SNOW_OBJECT2 = 58;

const _IMAGE_FOREST_TILES = 60;
const _IMAGE_FOREST_TILES30 = 61;
const _IMAGE_FOREST_TILES5 = 62;
const _IMAGE_FOREST_SMTILES = 63;
const _IMAGE_FOREST_HOUSES = 64;
const _IMAGE_FOREST_CLIFFS = 65;
const _IMAGE_FOREST_DUNGEONS = 66;
const _IMAGE_FOREST_INNERS = 67;
const _IMAGE_FOREST_FUNITURES = 68;
const _IMAGE_FOREST_WALLS = 69;
const _IMAGE_FOREST_SMOBJECTS = 70;
const _IMAGE_FOREST_ANIMATIONS = 71;
const _IMAGE_FOREST_OBJECT1 = 72;
const _IMAGE_FOREST_OBJECT2 = 73;


const _IMAGE_INTER = 80;
const _IMAGE_INTEREX = 79;

const _IMAGE_M_HUMAN = 81;
const _IMAGE_M_HAIR = 82;
const _IMAGE_M_HELMET1 = 83;
const _IMAGE_M_HELMET2 = 84;
const _IMAGE_M_WEAPON1 = 85;
const _IMAGE_M_WEAPON2 = 86;
const _IMAGE_M_WEAPON3 = 87;
const _IMAGE_M_WEAPON4 = 88;
const _IMAGE_M_WEAPON5 = 89;

const _IMAGE_WM_HUMAN = 90;
const _IMAGE_WM_HAIR = 91;
const _IMAGE_WM_HELMET1 = 92;
const _IMAGE_WM_HELMET2 = 93;
const _IMAGE_WM_WEAPON1 = 94;
const _IMAGE_WM_WEAPON2 = 95;
const _IMAGE_WM_WEAPON3 = 96;
const _IMAGE_WM_WEAPON4 = 97;
const _IMAGE_WM_WEAPON5 = 98;

const _IMAGE_MAGIC = 99;
const _IMAGE_MAGICEX = 100;
const _IMAGE_ITEM_INVENTORY = 101;
const _IMAGE_ITEM_EQUIP = 102;
const _IMAGE_ITEM_GROUND = 103;
const _IMAGE_MICON = 104;
const _IMAGE_MMAP = 105;
const _IMAGE_PROGUSE = 106;
const _IMAGE_HORSE = 107;

const _IMAGE_MONSTER1 = 108;
const _IMAGE_MONSTER2 = 109;
const _IMAGE_MONSTER3 = 110;
const _IMAGE_MONSTER4 = 111;
const _IMAGE_MONSTER5 = 112;
const _IMAGE_MONSTER6 = 113;
const _IMAGE_MONSTER7 = 114;
const _IMAGE_MONSTER8 = 115;
const _IMAGE_MONSTER9 = 116;
const _IMAGE_MONSTER10 = 117;
const _IMAGE_MONSTER11 = 118;
const _IMAGE_MONSTER12 = 119;
const _IMAGE_MONSTER13 = 120;
const _IMAGE_MONSTER14 = 121;
const _IMAGE_MONSTER15 = 122;
const _IMAGE_MONSTER16 = 123;
const _IMAGE_MONSTER17 = 124;
const _IMAGE_MONSTER18 = 125;
const _IMAGE_MONSTER19 = 126;
const _IMAGE_MONSTER20 = 127;
const _IMAGE_MONSTER54 = 128;

const _IMAGE_SMONSTER1 = 129;
const _IMAGE_SMONSTER2 = 130;
const _IMAGE_SMONSTER3 = 131;
const _IMAGE_SMONSTER4 = 132;
const _IMAGE_SMONSTER5 = 133;
const _IMAGE_SMONSTER6 = 134;
const _IMAGE_SMONSTER7 = 135;   
const _IMAGE_SMONSTER8 = 136;
const _IMAGE_SMONSTER9 = 137;
const _IMAGE_SMONSTER10 = 138;   
const _IMAGE_SMONSTER11 = 139;
const _IMAGE_SMONSTER12 = 140;
const _IMAGE_SMONSTER13 = 141;
const _IMAGE_SMONSTER14 = 142;
const _IMAGE_SMONSTER15 = 143;
const _IMAGE_SMONSTER16 = 144;
const _IMAGE_SMONSTER17 = 145;
const _IMAGE_SMONSTER18 = 146;
const _IMAGE_SMONSTER19 = 147;
const _IMAGE_SMONSTER20 = 148;

const _IMAGE_NPC = 149;
const _IMAGE_NPCFACE = 150;

const _IMAGE_MONIMAGE = 151;
const _IMAGE_MONMAGIC = 152;
const _IMAGE_MONMAGICEX1 = 153;
const _IMAGE_MONMAGICEX2 = 154;
const _IMAGE_MONMAGICEX3 = 155;
const _IMAGE_MONMAGICEX4 = 156;


const _MAX_MONSTER_IMAGE = 20;

const _MAX_IMAGE = 157;

const _TEXTR_FILE_MAGIC = 0;
const _TEXTR_FILE_MONMAGIC = 1;
const _TEXTR_FILE_MAP = 2;
const _TEXTR_FILE_INTER = 3;

const _MAX_TEXTR_FILE = 4;




/******************************************************************************************************************
    #1. Item Define
*******************************************************************************************************************/
const _ITEM_TYPE_INVENTORY              = 0;
const _ITEM_TYPE_EQUIP                  = 1;
const _ITEM_TYPE_GROUND                 = 2;

const _INVENTORY_CELL_WIDTH             = 38;
const _INVENTORY_CELL_HEIGHT            = 38;

const _CHAT_COLOR1                      = 0;    //RGB(  0,   0,   0); // Åõ°ú»ö.
const _CHAT_COLOR2                      = 1;    //RGB( 10,  10,  10); // °ËÁ¤»ö.
const _CHAT_COLOR3                      = 2;    //RGB(255, 255, 255); // Èò»ö.
const _CHAT_COLOR4                      = 3;    //RGB(255,   0,   0); // »¡°­.
const _CHAT_COLOR5                      = 4;    //RGB(  0, 255,   0); // ³ì»ö.
const _CHAT_COLOR6                      = 5;    //RGB(  0,   0, 255); // Çª¸¥»ö
const _CHAT_COLOR7                      = 6;    //RGB(255, 255,   0); // ³ë¶û»ö.
const _CHAT_COLOR8                      = 7;    //RGB(255, 128,   0); // ÁÖÈ²»ö

const _USER_NAMECLR1                    = 255;  //RGB(255, 255, 255); Èò»ö
const _USER_NAMECLR2                    = 251;  //RGB(255, 255,   0); ³ë¶õ»ö
const _USER_NAMECLR3                    = 249;  //RGB(255,   0,   0); »¡°£»ö
const _USER_NAMECLR4                    = 125;  //RGB(255,   0,   0); ??»ö(°á°è¾È ¸ó½ºÅÍ»ö)
const _USER_NAMECLR5                    = 47;   //RGB(165,  99,  57); °¥»ö
const _USER_NAMECLR6                    = 180;  //RGB(  0,   0, 255); Çª¸¥»ö
const _USER_NAMECLR7                    = 69;   //RGB(239, 107,   0); ÁÖÈ²»ö
const _USER_NAMECLR8                    = 221;  //RGB(  0, 148,   0); ³ì»ö
const _USER_NAMECLR9                    = 254;  //RGB(  0, 255, 255); »ö
const _USER_NAMECLR10                   = 147;  //RGB(140, 214, 239); »ö
const _USER_NAMECLR11                   = 154;  //RGB( 57, 181, 239); »ö
const _USER_NAMECLR12                   = 229;  //RGB(119, 136, 255); »ö
const _USER_NAMECLR13                   = 168;  //RGB(  0, 123, 222); »ö
const _USER_NAMECLR14                   = 252;  //RGB(  0,   0, 255); »ö




/******************************************************************************************************************
    #1. Actor Define
*******************************************************************************************************************/
const _GENDER_MAN                       = 0;
const _GENDER_WOMAN                     = 1;
const _GENDER_NPC                       = 50;
const _GENDER_MON                       = 3;    //77
const _MAX_GENDER                       = 4;

const _TARGETRGN_GAPX                   = 10;
const _TARGETRGN_GAPY                   = 8;

const _MAX_HERO_KIND                    = 10;
const _MAX_MON_KIND                     = 255;
const _MAX_NPC_KIND                     = 29;

/*const _MAX_DIRECTION                    = 8;
const _DIRECTION_LIST_1                 = 0;
const _DIRECTION_LIST_2                 = 1;
const _DIRECTION_LIST_3                 = 2;
const _DIRECTION_LIST_4                 = 3;
const _DIRECTION_LIST_5                 = 4;
const _DIRECTION_LIST_6                 = 5;     
const _DIRECTION_LIST_7                 = 6;
const _DIRECTION_LIST_8                 = 7;*/ 

public enum Dir : ubyte
{
    Up = 0,
    UpRight = 1,
    Right = 2,
    DownRight = 3,
    Down = 4,
    DownLeft = 5,
    Left = 6,
    UpLeft = 7,
    Min = Up,
    Max = UpLeft
}

const _DEFAULT_SPELLFRAME               = 10;
const _DEFAULT_DELAYTIME                = 300;

const _HAIR_NONE                        = 0;
const _MAX_HAIR                         = 7;

const _WEAPON_NONE                      = 0;        
const _MAX_WEAPON                       = 32;       

const _HORSE_NONE                       = 0;
const _MAX_HORSE                        = 4;

const _MAX_WEAPON_MTN                   = 25;
const _MAX_WEAPON_FRAME                 = 3000;

const _START_HORSE_FRAME                = 2320;
const _START_HORSE_MTN                  = 29;
const _MAX_HORSE_FRAME                  = 400;

const _MY_CENTER_XPOS                   = 400;
const _MY_CENTER_YPOS                   = 243;

const _MAX_CHAT_LINE                    = 5;
const _CHAT_WIDTH                       = 144;
//const _GAPX_TILE_CHAR_MAP               = 11;
//const _GAPY_TILE_CHAR_MAP               = 11;
const _GAPX_TILE_CHAR_MAP               = 12;
const _GAPY_TILE_CHAR_MAP               = 12;
const _CHAR_CENTER_XPOS                 = 400;
const _CHAR_CENTER_YPOS                 = 243;

const _SPEED_WALK                       = 1;
const _SPEED_RUN                        = 2;
const _SPEED_HORSERUN                   = 3;

const _MOTION_LOCKTIME                  = 8000;
const _WARMODE_TIME                     = 5000;

const _JOB_KIND = 3;
const _JOB_TAO = 2;
const _JOB_WIZ = 1;
const _JOB_WAR = 0;


const _STATE_RED                        = 64690;
const _STATE_GREEN                      = 2016;
const _STATE_BLUE                       = 38079;        //31
const _STATE_YELLOW                     = 65504;
const _STATE_FUCHSIA                    = 64511;
const _STATE_GRAY                       = 0;
const _STATE_ABLEND                     = 1;
const _STATE_SHIELDUSE                  = 2;
const _STATE_NOTUSED                    = 0XFFFF;

const _RUN_MINHEALTH                    = 10;

const _DIG_NORMAL                       = 0;
const _DIG_UP                           = 1;
const _DIG_DOWN                         = 2;
const _DIG_DOWNDEL                      = 3;


/******************************************************************************************************************
    #1. Sprite Define
*******************************************************************************************************************/
// HeroÀÇ µ¿ÀÛ Á¤ÀÇ.(°ÔÀÓ³»ÀÇ ¸ðµç µ¿ÀÛÀ» Á¤ÀÇÇÑ´Ù.)

const _MAX_HERO_MTN                     = 33;           // ÃÖ´ë µ¿ÀÛ°¹¼ö.
const _MAX_HERO_FRAME                   = 3000;         // ´ÙÀ½ Hero·Î ³Ñ¾î°¡´Â ÃÖ´ë ÇÁ·¹ÀÓ °¹¼ö.
const _MAX_HERO_REALFRAME               = 2640;

enum Motion : ubyte
{
    Stand = 0,              // À¯ÈÞµ¿ÀÛ.
    ArrowAttack = 1,        // È°°ø°Ý.
    Spell1 = 2,             // ¸¶¹ý ½ÃÀü1.
    Spell2 = 3,             // ¸¶¹ý °ø°Ý ½ÃÀü2.
    Hold = 4,               // °ßµð±â.
    PushBack = 5,           // µÚ·Î ¹Ð·Á³ª±â.
    PushBackFly = 6,        // µÚ·Î ³¯¶ó¼­ ¹Ð·Á³ª±â.
    AttackMode = 7,         // ÀüÅõ¸ðµå.
    Cut = 8,                // °í±â ½ä±â.
    OneVSwing = 9,          // ÇÑ¼Õ Á¾º£±â.(µ¿ÀÛ 9¹øºÎÅÍ 14¹ø±îÁö¿¡¼­ ¹«±âÀÇ Á¾·ù¿¡ µû¶ó µ¿ÀÛÀÌ Á¤ÇØÁø´Ù.)
    TwoVSwing = 10,         // µÎ¼Õ Á¾º£±â.
    OneHSwing = 11,         // ÇÑ¼Õ È¾º£±â.
    TwoHSwing = 12,         // µÎ¼Õ È¾º£±â. 
    SpearVSwing = 13,       // Ã¢ Á¾º£±â.
    SpearHSwing = 14,       // Ã¢ È¾º£±â.
    Hitted = 15,            // ¸Â±â.
    WheelWind = 16,         // µ¹¸é¼­ º£±â.
    RandSwing = 17,         // ¸¶±¸ º£±â.
    BackDropKick = 18,      // µÚµ¹¾Æ Â÷±â.
    Die = 19,               // Á×±â.
    SpecialDie = 20,        // Æ¢¾î¿Ã¶ó Á×±â.
    Walk = 21,              // °È±â.
    Run = 22,               // ´Þ¸®±â.
    Rush = 23,           // ¹«ÅÂº¸ ¶Ù±â.
    Roll = 24,              // ±¸¸£±â.
    FishStand = 25,         // ³¬½Ã¸ðµå À¯ÈÞ.
    FishHand = 26,          // ³¬½Ã¸ðµå.
    FishThrow = 27,         // ³¬½ÃÁÙ ´øÁö±â.
    FishPull = 28,          // ³¬½ÃÁÙ ´ç±â±â.
    HorseStand = 29,        // ½Â¸¶¸ðµå À¯ÈÞ.
    HorseWalk = 30,         // ½Â¸¶¸ðµå °È±â.
    HorseRun = 31,          // ½Â¸¶¸ðµå ´Þ¸®±â.
    HorseHit = 32           // ½Â¸¶¸ðµå ¸Â±â.
}

// MonsterÀÇ µ¿ÀÛ Á¤ÀÇ.(°ÔÀÓ³»ÀÇ ¸ðµç µ¿ÀÛÀ» Á¤ÀÇÇÑ´Ù.)
const _MAX_MON_MTN                      = 10;           // ÃÖ´ë µ¿ÀÛ°¹¼ö.
const _MAX_MON_FRAME                    = 1000;         // ´ÙÀ½ Mon·Î ³Ñ¾î°¡´Â ÃÖ´ë ÇÁ·¹ÀÓ °¹¼ö.

enum MonsterMotion : ubyte
{
    Stand = 0,              // À¯ÈÞµ¿ÀÛ.
    Walk = 1,               // °È±âµ¿ÀÛ.
    AttackA = 2,            // ÀÏ¹Ý°ø°Ýµ¿ÀÛ1.
    Hitted = 3,             // ¸Â±âµ¿ÀÛ.
    Die = 4,                // Á×±âµ¿ÀÛ.
    AttackB = 5,            // ÀÏ¹Ý°ø°Ýµ¿ÀÛ2.
    SpellA = 6,             // ¸¶¹ý°ø°Ýµ¿ÀÛ1.
    SpellB = 7,             // ¸¶¹ý°ø°Ýµ¿ÀÛ2.
    Appear = 8,             // ³ªÅ¸³ª±âµ¿ÀÛ.
    SpecialMotion = 9       // Æ¯¼öµ¿ÀÛ1.
}


// NPCÀÇ µ¿ÀÛ Á¤ÀÇ.(°ÔÀÓ³»ÀÇ ¸ðµç µ¿ÀÛÀ» Á¤ÀÇÇÑ´Ù.)
// NPC °ü·ÃÁ¤ÀÇ.
const _MAX_NPC_MTN                      = 3;            // ÃÖ´ë µ¿ÀÛ°¹¼ö.
const _MAX_NPC_FRAME                    = 100;          // ´ÙÀ½ NPC·Î ³Ñ¾î°¡´Â ÃÖ´ë ÇÁ·¹ÀÓ °¹¼ö.

enum NpcMotion : ubyte
{
    Stand = 0,
    Act1 = 1,               // Æ¯¼öµ¿ÀÛ1.
    Act2 = 2                // Æ¯¼öµ¿ÀÛ2.
}

// ±âµµ.                        0           
// ¹«±â´ëÀåÀåÀÌ.                1           
// ¹æ¾î±¸´ëÀåÀåÀÌ.              2           
// ¿©°üÁ¾¾÷¿ø.                  3           
// Ä«¿îÅÍ.                      4           
// °æ¸Å¾È³»ÀÚ.                  5           
// °í±Þ»ç¼­.                     6           
// µµ¼­°ü°æºñ.                   7           
// »ç¼­.                         8           
// Á¢¼öÃ³.                      9           
// ¾àÃÊÇÒ¾Æ¹öÁö.                10          
// ÀÇ·ù»ó.                      11          
// ÁÖÁ¡NPC.                     12          
// »ç¸·Àü»ç.                    13          
// ´ëÀå°£Á¾¾÷¿ø.                14          
// µµ¹ÚÀåÃ¥ÀÓÀÚ.                15          
// ¿¾³¯´ëÀåÀåÀÌ.                16          
// ¿¾³¯¾à¹æ³ëÀÎ.                17          
// ¿¾³¯Ã¥¹æ³ëÀÎ.                18          
// Àâ»óÀÎ.                      19          
// ÀâÈ­»ó.                       20          
// ÀâÈ­»ó.                       21          
// ÀâÈ­»ó.                       22          
// Á¡ÀïÀÌ.                      23          
// Æ÷¸ñ»ó.                      24          
// ¿©°ü¾ÆÁÜ¸¶.                  25
// À½½ÄÁ¡ÇÒ¹è.                  26
// Á¤À°Á¡ÁÖÀÎ.                  27          
// ÇàÁ¤°ü.                      28          





// ¸¶¹ýÈ¿°ú°ü·ÃÁ¤ÀÇ.
const _MAX_EFFECT                       = 33;
const _MAX_MAGIC                        = 52;
const _MAX_EXPLOSION                    = 8;





/******************************************************************************************************************
    #1. Chat Popup Wnd
*******************************************************************************************************************/
const _MAX_CHATLINE_POPUP               = 19;





/******************************************************************************************************************
    #1. Button Wnd
*******************************************************************************************************************/
const _BTN_STATE_NORMAL                 = 0;
const _BTN_STATE_FOCUS                  = 1;
const _BTN_STATE_CLICK                  = 2;

const _BTN_TYPE_NOFOCUS                 = 0;
const _BTN_TYPE_FOCUS                   = 1;





/******************************************************************************************************************
    #1. Game Procedure
*******************************************************************************************************************/
const _CLIP_WIDTH                       = 800;
const _CLIP_HEIGHT                      = 485;
const _TIMER_ID                         = 1;

const _ET_DIGOUTZOMBI                   = 1;    //Á»ºñ°¡ ¶¥ÆÄ°í ³ª¿Â ÈçÀû
const _ET_MINE                          = 2;    //±¤¼®ÀÌ ¸ÅÀåµÇ¾î ÀÖÀ½
const _ET_PILESTONES                    = 3;    //µ¹¹«´õ±â
const _ET_HOLYCURTAIN                   = 4;    //°á°è
const _ET_FIRE                          = 5;
const _ET_SCULPEICE                     = 6;    //ÁÖ¸¶¿ÕÀÇ µ¹±úÁø Á¶°¢

const _MAX_CELL_OBJ                     = 10;

// Day Bright.
public enum DayState : ubyte
{
    Dusk = 0,       // »õº®.
    Day = 1,        // ³·.
    Dawn = 2,       // Àú³á.
    Night = 3       // ¹ã.
}


// Fog Bright.
public enum FogState : ubyte
{
    Day = 0,        // ³·.
    Night = 1,      // ¹ã.
    Dawn = 2        // »õº®, Àú³á.
}





/******************************************************************************************************************
    #1. Interface
*******************************************************************************************************************/
const _INPUT_EDITWND_XPOS               = 223;
const _INPUT_EDITWND_YPOS               = 549;
const _INPUT_EDITWND_WIDTH              = 353;
const _INPUT_EDITWND_HEIGHT             = 15;

// ¸ÞÀÎÀÎÅÍÆäÀÌ½º¿¡¼­ ¾²ÀÏ À©µµ¿ì ¾ÆÀÌµð.
const _WND_ID_INVENTORY                 = 0;            //°¡¹æÀ©µµ¿ì.
const _WND_ID_STATUS                    = 1;            //Ä³¸¯ÅÍ Á¤º¸ º¸±âÀ©µµ¿ì(3°³).
const _WND_ID_STORE                     = 2;            //»óÁ¡À©µµ¿ì.
const _WND_ID_EXCHANGE                  = 3;            //±³È¯À©µµ¿ì.
const _WND_ID_GUILD                     = 4;            //¹®¿øÀ©µµ¿ì.
const _WND_ID_GUILDMASTER               = 5;            //¹®ÁÖÀ©µµ¿ì.
const _WND_ID_GROUP                     = 6;            //±×·ìÀ©µµ¿ì.
const _WND_ID_GROUPPOP                  = 7;            //
const _WND_ID_CHATPOP                   = 8;            //
const _WND_ID_NPCCHAT                   = 9;        
const _WND_ID_MESSAGEBOX                = 10;           // MessageBox
const _WND_ID_QUEST                     = 11;           // 
const _WND_ID_OPTION                    = 12;           // 
const _WND_ID_HORSE                     = 13;           //

const _WND_ID_LOGIN                     = 20; 

// ¸ÞÀÎ ÀÎÅÍÆäÀÌ½º¿¡¼­ ¾²ÀÏ À©µµ¿ìÀÇ ÀÌ¹ÌÁö ÀÎµ¦½º.
const _WNDIMGIDX_MAIN                   = 1160;         //¸ÞÀÎÀÎÅÍÆäÀÌ½ºÃ¤ÆÃÃ¢
const _WNDIMGIDX_INVENTORY              = 1220;         //ÀÎº¥Åä¸®
const _WNDIMGIDX_ITEMSET                = 200;          //
const _WNDIMGIDX_SKILLSET               = 202;          //¹«°ø¼³Á¤Ã¢
const _WNDIMGIDX_STATUS                 = 201;          //
const _WNDIMGIDX_CHARINFO               = 201;          //
const _WNDIMGIDX_STORE                  = 253;          //»óÁ¡¹°°Ç»ç±â
const _WNDIMGIDX_EXCHANGE               = 251;          //±³È¯Ã¢
const _WNDIMGIDX_GUILDMASTER            = 600;          //¹®ÁÖ°Ô½ÃÆÇ.
const _WNDIMGIDX_GUILD                  = 169;          //¹®¿ø°Ô½ÃÆÇ.
const _WNDIMGIDX_GROUP                  = 1360;         //±×·ìÃ¢.
const _WNDIMGIDX_GROUPPOP               = 145;          //±×·ìÀÔ·ÂÃ¢.
const _WNDIMGIDX_CHATPOP                = 350;          //Ã¤ÆÃÆË¾÷Ã¢.
const _WNDIMGINDX_MSGBOX                = 1240;
const _WNDIMGIDX_NPCCHAT                = 300;          //NPC´ëÈ­Ã¢
const _WNDIMGIDX_QUEST                  = 700;          //Äù½ºÆ®Ã¢.
const _WNDIMGIDX_OPTION                 = 750;          //¿É¼ÇÃ¢.
const _WNDIMGIDX_HORSE                  = 850;          //¸»Ã¢.
const _WNDIMGIDX_NOTICEBOX              = 1250;         //°øÁöÃ¢ ÀÎµ¦½º

const _IMGIDX_BELT                      = 51;

// ¸ÞÀÎÀÎÅÍÆäÀÌ½º¿¡¼­ ¾²ÀÏ ¹öÆ° ¾ÆÀÌµð.
const _BTN_ID_CHANGE                    = 0;
const _BTN_ID_MINIMAP                   = 1;
const _BTN_ID_MUGONG                    = 2;
const _BTN_ID_EXIT                      = 3;
const _BTN_ID_LOGOUT                    = 4;
const _BTN_ID_GROUP                     = 5;
const _BTN_ID_GUILD                     = 6;
const _BTN_ID_BELT                      = 7;
const _BTN_ID_MAGIC                     = 8;
const _BTN_ID_POPUP                     = 9;
const _BTN_ID_QUEST                     = 10;
const _BTN_ID_OPTION                    = 11;
const _BTN_ID_HELP                      = 12;
const _BTN_ID_HORSE                     = 13;
const _BTN_ID_BAG                       = 14;
const _BTN_ID_CHAR                      = 15;

const _MAX_INTER_BTN                    = 16;
const _MAX_CHATLINE                     = 5;

const _MAX_SAVECHATLINE                 = 50;

const _BELT_STATE_STAY                  = 0;
const _BELT_STATE_UP                    = 1;
const _BELT_STATE_DOWN                  = 2;











/******************************************************************************************************************
    #1. Inventory Window
*******************************************************************************************************************/
const _INVEN_MAX_CELL                   = 25;
const _BELT_MAX_CELL                    = 6;
const _INVEN_CELL_XCNT                  = 5;
const _INVEN_CELL_YCNT                  = 5;
const _INVEN_MAX_CELL_YCNT              = 12;
const _INVEN_CELL_XSTART                = 44;
const _INVEN_CELL_YSTART                = 55;

const _BELT_CELL_XGAP                   = 40;
const _BELT_CELL_XSTART                 = 18;
const _BELT_CELL_YSTART                 = 220;

const _MAX_INVEN_BTN                    = 1;    //2
const _MAX_INVEN_ITEM                   = 60;
const _MAX_BELT_ITEM                    = 6;

const _BTN_ID_INVENCLOSE                = 0;
//const _BTN_ID_INVENSCRLUP               = 1;
//const _BTN_ID_INVENSCRLDOWN             = 2;





/******************************************************************************************************************
    #1. Light fog
*******************************************************************************************************************/
const NUM_CNTX_LIGHTTILE                = 17;
const NUM_CNTY_LIGHTTILE                = 21;
const TILE_START_XPOS                   = -8;
const TILE_START_YPOS                   = -29;

const TILE_WIDTH                        = 48;
const TILE_HEIGHT                       = 32;

const NUM_LIGHTTILE_INDICES             = (NUM_CNTX_LIGHTTILE)*(NUM_CNTY_LIGHTTILE)*3*2;
const NUM_LIGHTTILE_VERTICES            = (NUM_CNTX_LIGHTTILE+1)*(NUM_CNTY_LIGHTTILE+1);



/******************************************************************************************************************
    #1. Magic
*******************************************************************************************************************/
const _MAGIC_ACTIVE                     = 0;            // ¸¶¹ýÈ°¼º»óÅÂ.
const _LIGHT_ACTIVE                     = 1;            // ¸¶¹ý±¤¿øÈ°¼º»óÅÂ.
const _MAGIC_FINISH                     = 2;            // ¸¶¹ý¼Ò¸ê.

const _SKILL_FIREBALL                   = 1;            // È­¿°Àå.
const _SKILL_HEALLING                   = 2;            // È¸º¹¼ú.
const _SKILL_ONESWORD                   = 3;            // ¿Ü¼ö.
const _SKILL_ILKWANG                    = 4;            // ÀÏ±¤.
const _SKILL_FIREBALL2                  = 5;            // ±Ý°­È­¿°Àå.
const _SKILL_AMYOUNSUL                  = 6;            // ¾Ï¿¬¼ú.
const _SKILL_YEDO                       = 7;            // ¿¹µµ.
const _SKILL_FIREWIND                   = 8;            // È­¿°Ç³.
const _SKILL_FIRE                       = 9;            // ¿°»çÀå.
const _SKILL_SHOOTLIGHTEN               = 10;           // ·ÚÀÎÀå.
const _SKILL_LIGHTENING                 = 11;           // °­°Ý.
const _SKILL_ERGUM                      = 12;           // ¾î°Ë¼ú.
const _SKILL_FIRECHARM                  = 13;           // Æø»ì°è.
const _SKILL_HANGMAJINBUB               = 14;           // Ç×¸¶Áø¹ý.
const _SKILL_DEJIWONHO                  = 15;           // ´ëÁö¿øÈ£.
const _SKILL_HOLYSHIELD                 = 16;           // °á°è.
const _SKILL_SKELLETON                  = 17;           // ¹é°ñ¼ÒÈ¯¼ú.
const _SKILL_CLOAK                      = 18;           // Àº½Å.
const _SKILL_BIGCLOAK                   = 19;           // ´ëÀº½Å.
const _SKILL_TAMMING                    = 20;           // ·ÚÈ¥°Ý.
const _SKILL_SPACEMOVE                  = 21;           // ¾Æ°øÇà¹ý.
const _SKILL_EARTHFIRE                  = 22;           // Áö¿°¼ú.
const _SKILL_FIREBOOM                   = 23;           // Æø¿­ÆÄ.
const _SKILL_LIGHTFLOWER                = 24;           // ·Ú¼³È­.
const _SKILL_BANWOL                     = 25;           // ¹Ý¿ù.
const _SKILL_FIRESWORD                  = 26;           // ¿°È­°á.
const _SKILL_MOOTEBO                    = 27;           // ¹«ÅÂº¸.
const _SKILL_SHOWHP                     = 28;           // Å½±âÆÄ¿¬.
const _SKILL_BIGHEALLING                = 29;           // ´ëÈ¸º¹.
const _SKILL_SINSU                      = 30;           // ½Å¼ö¼ÒÈ¯.
const _SKILL_SHIELD                     = 31;           // ÁÖ¼úÀÇ¸·.
const _SKILL_KILLUNDEAD                 = 32;           // »çÀÚÀ±È¸.
const _SKILL_SNOWWIND                   = 33;           // ºù¼³Ç³.

const _SKILL_JUMPSHOT                   = 33;           // Á¡ÇÁÇØ¼­Ä¡±â °Ë±â.
const _SKILL_RANDSWING                  = 34;           // ¸¶±¸ ÈÖµÎ¸£±â.
const _SKILL_SPACEMOVE2                 = 35;           // ¾Æ°øÇà¹ý2.
const _SKILL_SPACEMOVE3                 = 36;           // ¾Æ°øÇà¹ý3.

const _MONMAGIC_KEPAL                   = 100;          // Àü°Ý°ø°Ý.(°ø°ÝÇÑ Ä³¸¯ÅÍÀ§¿¡)(¸¶¹ý)
const _MONMAGIC_EXPLODE                 = 101;          // Æø¹ß¸¶¹ý.(µ¹°ñ·½Á×À»¶§, ·Ð°ø°Ý½Ã)
const _MONMAGIC_BLACK1                  = 102;          // Èæ¸¶¹ý»ç. (¸¶¹ý(½ÃÀü))
const _MONMAGIC_BLACK2                  = 103;          // Èæ¸¶¹ý»ç. (¸¶¹ý(¸¶¹ý))
const _MONMAGIC_DIE                     = 104;          // Èæ¸¶¹ý»ç, °æ°©¿Ê±â»ç, È«¸¶¹ý»ç, ½Å±â¼±º¸½ºº¯½ÅÀü Á×À½.(È¿°ú)
const _MONMAGIC_ANTHEAL                 = 105;          // Ä¡À¯°³¹ÌÈú¸µ(¹ß»ç¸¶¹ý, Æø¹ßÈ¿°ú.)
const _MONMAGIC_GREATANT                = 106;          // °Å´ë°³¹Ì.(°ø°ÝÇÑ Ä³¸¯ÅÍÀ§¿¡)(¸¶¹ý)
const _MONMAGIC_MAGENUMA                = 108;          // °á°è.
const _MONMAGIC_ANT                     = 109;          // º´Á¤°³¹Ì°ø°Ý.(°ø°ÝÇÑ Ä³¸¯ÅÍÀ§¿¡)(¸¶¹ý)
const _MONMAGIC_WORKANT                 = 110;          // ÀÏ°³¹Ì°ø°Ý.(°ø°ÝÇÑ Ä³¸¯ÅÍÀ§¿¡)(¸¶¹ý)
const _MONMAGIC_RED1                    = 111;          // È«¸¶¹ý»ç. (¸¶¹ý(½ÃÀü))
const _MONMAGIC_RED2                    = 112;          // È«¸¶¹ý»ç. (¸¶¹ý(¸¶¹ý))
const _MONMAGIC_COWGHOST                = 113;          // ¿ì¸é±Í. (¸¶¹ý)
const _MONMAGIC_SINSU                   = 114;          // ½Å¼ö. (¸¶¹ý)
const _MONMAGIC_ZOMBIE                  = 115;          // Á»ºñ. (¸¶¹ý)
const _MONMAGIC_JUMAWANG                = 116;          // ÁÖ¸¶¿Õ. (¸¶¹ý)
const _MONMAGIC_CHIM                    = 117;
const _MONMAGIC_ARROW                   = 118;
const _MONMAGIC_MAARROW                 = 119;
const _MONMAGIC_DUALAXE                 = 120;
const _MONMAGIC_COWFLAME                = 121;
const _MONMAGIC_BIGGINE_ATT             = 122;
const _MONMAGIC_BIGGINE_CHAR            = 123;
const _MONMAGIC_SANDFISH                = 124;
const _MONMAGIC_BAODIE                  = 125;
const _MONMAGIC_SINGI_DIE               = 126;
const _MONMAGIC_HUSU_DIE                = 127;
const _MONMAGIC_ZOMBIE_DIE              = 128;
const _MONMAGIC_SSEGI                   = 129;
const _MONMAGIC_NUMAGUMGI               = 130;
const _MONMAGIC_EXPLODE1                = 131;

enum Blend: ubyte
{
    Normal = 0,            // ÀÏ¹ÝÀûÀÎ±×¸®±â.(¾ËÆÄ°ªÀÌ Àû¿ëµÉ¼öÀÖ´Ù.)
    Light = 1,            // ¼¶±¤È¿°úÇüÅÂÀÇ ºí·»µù.
    LightInv = 2,    
    InvNormal = 3,
    InvLight = 4,
    InvLightInv = 5
}




/******************************************************************************************************************
    #1. Map Handler
*******************************************************************************************************************/

const _BASETILE_WIDTH                   = 96;           // ±âº»Å¸ÀÏ ³ÐÀÌ.
const _BASETILE_HEIGHT                  = 64;
    
const _CELL_WIDTH                       = 48;           // ±âº»¼¿ ³ÐÀÌ, ±âº»Å¸ÀÏÀº 4°³ÀÇ ¼¿·Î ÀÌ·ç¾îÁö°í Á¤º¸´Â ¼¿´ÜÀ§·Î ÀúÀåµÈ´Ù.
const _CELL_HEIGHT                      = 32;

const _VIEW_CELL_X_COUNT                = 24;           // ºä¿µ¿ª¿¡ ÇÊ¿äÇÑ XÃàÀÇ ¼¿´ÜÀ§ °³¼ö.((Â¥Åõ¸® Å¸ÀÏÁ¦¿Ü)ÁÂ¿ÍÀ§·Î 3¼¿, ¿ì¿Í¾Æ·¡·Î 2¼¿¾¿ÀÇ ¿©À¯¸¦ µÐ´Ù.)
const _VIEW_CELL_Y_COUNT                = 24;           
const _VIEW_CELL_Y_COUNT_FOR_OBJ        = 44;

const _VIEW_CELL_X_START                = -200;         // ºä¿µ¿ªÀ» ±×¸®±â À§ÇÑ ½ÃÀÛ ¼¿ XÁÂÇ¥.
const _VIEW_CELL_Y_START                = -157;
const _MAX_TILE_FILE                    = 74;

// Æ÷±×»ö °ü·Ã ¼Ó¼º.
const _FOG_COLOR_TYPE0                  = ALLEGRO_COLOR(10/255.0f, 10/255.0f, 10/255.0f, 1);
const _FOG_COLOR_TYPE1                  = ALLEGRO_COLOR(100/255.0f, 10/255.0f, 10/255.0f, 1);
const _FOG_COLOR_TYPE2                  = ALLEGRO_COLOR(10/255.0f, 255/255.0f, 10/255.0f, 1);
const _FOG_COLOR_TYPE3                  = ALLEGRO_COLOR(10/255.0f, 10/255.0f, 255/255.0f, 1);

// ¼Ó¼º °ü·Ã Á¤ÀÇ.
const _CAN_WALK                         = 0;
const _CAN_NOTWALK                      = 1;
const _CAN_FLY                          = 0;
const _CAN_NOTFLY                       = 1;

// ¶óÀÌÆ® Å©±â °ü·Ã Á¤ÀÇ.
const _LIGHT_SIZE_TYPE0                 = 3;
const _LIGHT_SIZE_TYPE1                 = 4;
const _LIGHT_SIZE_TYPE2                 = 5;
const _LIGHT_SIZE_TYPE3                 = 6;

// ¶óÀÌÆ® »ö °ü·Ã Á¤ÀÇ.
const _LIGHT_COLOR_TYPE0                = ALLEGRO_COLOR(1, 0, 0, 1);
const _LIGHT_COLOR_TYPE1                = ALLEGRO_COLOR(0, 1, 0, 1);
const _LIGHT_COLOR_TYPE2                = ALLEGRO_COLOR(0, 0, 1, 1);
const _LIGHT_COLOR_TYPE3                = ALLEGRO_COLOR(1, 0, 1, 1);

// ¹®°ü·Ã Á¤ÀÇ.
const _DOOR_ISCLOSED                    = 0;
const _DOOR_ISOPEN                      = 1;

const _TILE_ANI_DELAY_1                 = 150;
const _TILE_ANI_DELAY_2                 = 200;
const _TILE_ANI_DELAY_3                 = 250;
const _TILE_ANI_DELAY_4                 = 300;
const _TILE_ANI_DELAY_5                 = 350;
const _TILE_ANI_DELAY_6                 = 400;
const _TILE_ANI_DELAY_7                 = 420;
const _TILE_ANI_DELAY_8                 = 450;






/******************************************************************************************************************
    #1. Status Window
*******************************************************************************************************************/
const _TYPE_EQUIP                       = 0;
const _TYPE_STATUS                      = 1;
const _TYPE_SETMAGIC                    = 2;

const _EQUIP_MAX_CELL                   = 10;
const _MAGIC_MAX_CELL                   = 5;
const _MAGIC_MAX_KEY                    = 8;

const _MAX_TYPE_WND                     = 3;

const _MAX_STAUTS_BTN                   = 3;

const _BTN_ID_STATUSCLOSE               = 0;
const _BTN_ID_STATUS                    = 1;
const _BTN_ID_STATUSMAGIC               = 2;

const _BTN_ID_STATUS_X                  = 187;
const _BTN_ID_STATUS_Y                  = 266;
const _BTN_ID_STATUSMAGIC_X             = 224;
const _BTN_ID_STATUSMAGIC_Y             = 98;

const _EQUIP_CHAR_X                     = 100;
const _EQUIP_CHAR_Y                     = 200;

const _U_DRESS                          = 0;
const _U_WEAPON                         = 1;
const _U_RIGHTHAND                      = 2;
const _U_NECKLACE                       = 3;
const _U_HELMET                         = 4;
const _U_ARMRINGL                       = 5;
const _U_ARMRINGR                       = 6;
const _U_RINGL                          = 7;
const _U_RINGR                          = 8;
const _U_CHARM                          = 9;
const _U_UNEQUIP                        = 100;

const _MAX_MAGIC_SKILL                  = 32;




/******************************************************************************************************************
    #1. Store Window
*******************************************************************************************************************/
const _STORE_STATE_SELL                 = 0;
const _STORE_STATE_BUY                  = 1;




/+

/******************************************************************************************************************
    #1. Client To Server Message
*******************************************************************************************************************/
const CM_QUERYUSERNAME                  = 80;
const CM_QUERYBAGITEMS                  = 81;
const CM_DROPITEM                       = 1000;
const CM_PICKUP                         = 1001;
const CM_TAKEONITEM                     = 1003;
const CM_TAKEOFFITEM                    = 1004;
const CM_EAT                            = 1006;
const CM_MAGICKEYCHANGE                 = 1008;
const CM_LOGINNOTICEOK                  = 1018;
const CM_GROUPMODE                      = 1019;    // ***************************************
const CM_CREATEGROUP                    = 1020;    // ***************************************
const CM_ADDGROUPMEMBER                 = 1021;    // ***************************************
const CM_DELGROUPMEMBER                 = 1022;    // ***************************************
const CM_TRUN                           = 3010;
const CM_WALK                           = 3011;
const CM_RUN                            = 3013;
const CM_HIT                            = 3014;
const CM_LONGHIT                        = 3019;
const CM_POWERHIT                       = 3018;
const CM_SPELL                          = 3017;    // º¸³½ÈÄ ¼­¹ö¿¡¼­ ½ÂÀÎÀÌ ¿À¸é µ¿ÀÛÀ» ÇÑ´Ù. ½ºÆçµ¿ÀÛÀÌ ³¡³­ÈÄ sm_magicfire°¡ ¿À¸é µ¿ÀÛÀ» ½ºÅÄµå·Î ¹Ù²Û´Ù.
const CM_WIDEHIT                        = 3024;
const CM_FIREHIT                        = 3025;
const CM_SAY                            = 3030;
const CM_RIDE                           = 3031;

const CM_BUTCH                          = 1007;
const CM_SITDOWN                        = 3012;
const CM_OPENDOOR                       = 1002;


//¿ë±â
////////////////////////////////////////////////////////////////////////////////////////////////////////
// °øÅë
const CM_CLICKNPC                       = 1010;    // ÀÌ ¸Þ½ÃÁö¸¦ ¼­¹ö·Î º¸³»¾î ÇØ´ç MPCÀÇ Á¤º¸¸¦ ¹Þ´Â´Ù.
const CM_MERCHANTDLGSELECT              = 1011;    // »ç¿ëÀÚ°¡ NPC´ëÈ­Áß Tag°¡ Á¸ÀçÇÏ´Â ºÎºÐÀ» ClickÇßÀ»°æ¿ì º¸³»¾îÁø´Ù.
////////////////////////////////////////////////////////////////////////////////////////////////////////
// ÆÈ±â
const CM_MERCHANTQUERYSELLPRICE         = 1012;    // ÆÈ±â ¹°°ÇÀ» ¿Ã·Á ³õÀ» °æ¿ì °¡°ÝÀ» ¾ò´Â´Ù.  
                                                   // º¯°æÇÒ ÇÊ¿ä°¡ ÀÖÀ½ (°ú°Å: ÆÈ¹°°ÇÀÇ °¡°Ý¸¸ Ç¥½Ã, ÇöÀç: ÆÈ¸®´Â ¹°°ÇÀÇ °¢°Ü ¸ðµÎÇ¥½Ã)
const CM_USERSELLITEM                   = 1013;    // ÆÈ±â ¹öÆ°À» ´­·ÈÀ» °æ¿ì (°ú±â: ÆÈ¹°°Ç¸¸ ÇÏ³ª¸¸ º¸³¿, ÇöÀç: ÆÈ¹°°Ç ¸ðµÎ º¸³¿
////////////////////////////////////////////////////////////////////////////////////////////////////////
// »ç±â
const CM_USERBUYITEM                    = 1014;    // »ç±â ¹öÆ°À» ´­·ÈÀ» °æ¿ì
const CM_USERGETDETAILITEM              = 1015;    // »óÁ¡ ¸ñ·ÏÁß¿¡ Sub Menu°¡ ÀÖ´Â °ÍÀ» Å¬¸¯ÇßÀ» °æ¿ì
////////////////////////////////////////////////////////////////////////////////////////////////////////
// ¼ö¸®
const CM_USERREPAIRITEM                 = 1023;    // ¼ö¸®ÇÏ´Ù ¹öÆ°À» ´­·¶À» °æ¿ì
const CM_MERCHANTQUERYREPAIRCOST        = 1024;    // ¼ö¸®ÇÒ¾ÆÀÌÅÛÀ» ¿Ã·Á ³õÀ» °æ¿ì °¡°ÝÀ» ¾ò´Â´Ù.
////////////////////////////////////////////////////////////////////////////////////////////////////////
// ¾à¹æ
const CM_USERMAKEDRUGITEM               = 1034;    // 

////////////////////////////////////////////////////////////////////////////////////////////////////////
// ¿©°ü
const CM_USERSTORAGEITEM                = 1031;    // »ç¿ëÀÚ°¡ ¸º±ä´Ù ¹öÆ°(ÅØ½ºÆ® ¹öÆ° ¾Æ´Ô)À» ´­·¶À» °æ¿ì º¸³»¾îÁø´Ù.
const CM_USERTAKEBACKSTORAGEITEM        = 1032;    // »ç¿ëÀÚ°¡ Ã£´Â´Ù ¹öÆ°(ÅØ½ºÆ® ¹öÆ° ¾Æ´Ô)À» ´­·¶À» °æ¿ì º¸³»¾îÁø´Ù.
////////////////////////////////////////////////////////////////////////////////////////////////////////
// ¹®ÆÄ
const CM_OPENGUILDDLG                   = 1035;    // »ç¿ëÀÚ°¡ ¹®ÆÄÃ¢À» ¿­°íÀÚ ÇßÀ» °æ¿ì º¸³»¾îÁø´Ù.
const CM_GUILDHOME                      = 1036;    // »ç¿ëÀÚ°¡ ¹®ÆÄÃ¢Áß HOME ¹öÆ°À» ´­·¶À» °æ¿ì º¸³»¾îÁø´Ù.
const CM_GUILDMEMBERLIST                = 1037;    // »ç¿ëÀÚ°¡ ¹®ÆÄÃ¢Áß ¹®¿øLIST¸¦ º¸°íÀÚ ÇÞÀ» °æ¿ì
const CM_GUILDADDMEMBER                 = 1038;    // »ç¿ëÀÚ°¡ ¹®¿øÃß°¡¸¦ ÇßÀ» °æ¿ì
const CM_GUILDDELMEMBER                 = 1039;    // »ç¿ëÀÚ°¡ ¹®¿ø»èÁ¦¸¦ ÇßÀ» °æ¿ì
const CM_GUILDUPDATENOTICE              = 1040;    // »ç¿ëÀÚ°¡ ¹®ÆÄ°øÁö¸¦ ¼öÁ¤ ÇßÀ» °æ¿ì
const CM_GUILDUPDATERANKINFO            = 1041;    // »ç¿ëÀÚ°¡ ¹®¿øÁ÷À§¸¦ ¼öÁ¤ÇßÀ» °æ¿ì
const CM_GUILDMAKEALLY                  = 1044;    // »ç¿ëÀÚ°¡ ¹®ÆÄµ¿¸ÍÀ» ÇßÀ» °æ¿ì
const CM_GUILDBREAKALLY                 = 1045;    // »ç¿ëÀÚ°¡ ¹®ÆÄµ¿¸ÍÆÄ±â¸¦ ÇßÀ»°æ¿ì



/******************************************************************************************************************
    #1. Server To Client Message
*******************************************************************************************************************/
const SM_RUSH                           = 6;       // ¹«ÅÂº¸ ¹Ð±â.
const SM_FIREHIT                        = 8;
const SM_POWERHIT                       = 18;
const SM_BACKSTEP                       = 9;
const SM_TURN                           = 10;
const SM_WALK                           = 11;
const SM_RUN                            = 13;
const SM_HIT                            = 14;
const SM_SPELL                          = 17;      // ½ºÆçÀ» ÇÑ´Ù.
const SM_LONGHIT                        = 19;
const SM_DIGUP                          = 20;
const SM_DIGDOWN                        = 21;
const SM_FLYAXE                         = 22;
const SM_LIGHTING                       = 23;
const SM_WIDEHIT                        = 24;
const SM_DISAPPEAR                      = 30;
const SM_STRUCK                         = 31;
const SM_DEATH                          = 32;
const SM_NOWDEATH                       = 34;
const SM_HEAR                           = 40;
const SM_FEATURECHANGED                 = 41;
const SM_USERNAME                       = 42;
const SM_WINEXP                         = 44;
const SM_LEVELUP                        = 45;
const SM_DAYCHANGING                    = 46;
const SM_LOGON                          = 50;
const SM_NEWMAP                         = 51;
const SM_ABILITY                        = 52;
const SM_HEALTHSPELLCHANGED             = 53;
const SM_MAPDESCRIPTION                 = 54;

const SM_SYSMESSAGE                     = 100;
const SM_GROUPMESSAGE                   = 101;
const SM_CRY                            = 102;
const SM_WHISPER                        = 103;
const SM_GUILDMESSAGE                   = 104;

const SM_ADDITEM                        = 200;
const SM_BAGITEMS                       = 201;
const SM_ADDMAGIC                       = 210;
const SM_SENDMYMAGIC                    = 211;

const SM_DROPITEM_SCCESS                = 600;
const SM_DROPITEM_FAIL                  = 601;
const SM_ITEMSHOW                       = 610;
const SM_ITEMHIDE                       = 611;
const SM_TAKEON_OK                      = 615;
const SM_TAKEON_FAIL                    = 616;
const SM_DOOROPEN                       = 612;
const SM_TAKEOFF_OK                     = 619;
const SM_TAKEOFF_FAIL                   = 620;
const SM_SENDUSEITEMS                   = 621;
const SM_WEIGHTCHANGED                  = 622;
const SM_CHANGEMAP                      = 634;
const SM_CLEAROBJECT                    = 633;
const SM_EAT_OK                         = 635;
const SM_EAT_FAIL                       = 636;
const SM_MAGICFIRE                      = 638;     // ¸¶¹ýÀÌ ½ÇÇàµÈ´Ù.
const SM_MAGIC_LVEXP                    = 640;
const SM_DURACHANGE                     = 642;
const SM_GOLDCHANGE                     = 653;
const SM_CHANGELIGHT                    = 654;
const SM_CHANGENAMECOLOR                = 656;
const SM_CHARSTATUSCHANGE               = 657;
const SM_SENDNOTICE                     = 658;
const SM_CREATEGROUP_OK                 = 660;     // ******************************************************************
const SM_CREATEGROUP_FAIL               = 661;     // ******************************************************************
const SM_GROUPCANCEL                    = 666;     // ******************************************************************
const SM_GROUPMEMBERS                   = 667;     // ******************************************************************

const SM_CHANGEGUILDNAME                = 750;
const SM_SUBABILITY                     = 752;

const SM_SHOWEVENT                      = 804;
const SM_HIDEEVENT                      = 805;

const SM_DELITEM                        = 202;
const SM_DELITEMS                       = 203;

const SM_CLOSEHEALTH                    = 1101;
const SM_OPENHEALTH                     = 1100;
const SM_MONSTERSAY                     = 1501;
const SM_SITDOWN                        = 12;
const SM_BUTCH                          = 637;
const SM_SKELETON                       = 33;      // SM_DEATH¿Í µ¿ÀÏ.
const SM_CHANGEFACE                     = 1104;;

const SM_OPENDOOR_OK                    = 612;
const SM_OPENDOOR_LOCK                  = 613;
const SM_CLOSEDOOR                      = 614;

const SM_MERCHANTSAY                    = 643;
const SM_MERCHANTDLGCLOSE               = 644;
const SM_SENDGOODSLIST                  = 645;
const SM_SENDUSERSELL                   = 646;
const SM_SENDBUYPRICE                   = 647;
const SM_USERSELLITEM_OK                = 648;
const SM_USERSELLITEM_FAIL              = 649;
const SM_BUYITEM_SUCCESS                = 650;
const SM_BUYITEM_FAIL                   = 651;
const SM_SENDDETAILGOODSLIST            = 652;
const SM_GOLDCHANGED                    = 653;
const SM_OPENGUILDDLG                   = 753;
const SM_OPENGUILDDLG_FAIL              = 754;
const SM_SENDGUILDHOME                  = 755;
const SM_SENDGUILDMEMBERLIST            = 756;
const SM_GUILDADDMEMBER_OK              = 757;
const SM_GUILDADDMEMBER_FAIL            = 758;
const SM_GUILDDELMEMBER_OK              = 759;
const SM_GUILDDELMEMBER_FAIL            = 760;
const SM_GUILDRANKUPDATE_FAIL           = 761;
const SM_BUILDGUILD_OK                  = 762;
const SM_BUILDGUILD_FAIL                = 763;
const SM_GUILDMAKEALLY_OK               = 768;
const SM_GUILDMAKEALLY_FAIL             = 769;
const SM_GUILDBREAKALLY_OK              = 770;
const SM_GUILDBREAKALLY_FAIL            = 771;
const SM_DLGMSG                         = 772;


const SM_AREASTATE                      = 708;

const SM_RIDEHORSE                      = 1300;

/******************************************************************************************************************
    Resource Dll string index
*******************************************************************************************************************/
const PUNISHMENT_ID_USING               = 1;
const PUNISHMENT_ID_THEFT               = 2;
const PUNISHMENT_DISTURB_GAME           = 3;
const PUNISHMENT_BBS_CURSES             = 4;
const PUNISHMENT_CONFIRMED_CURSES       = 5;
const PUNISHMENT_USAGE_BUG              = 6;
const PUNISHMENT_ASSUMED_GAMEMASTER     = 7;
const PUNISHMENT_SPREAD_FALLACY         = 8;
const NEW_ACCOUNT_HELP_ID               = 9;
const NEW_ACCOUNT_HELP_PWD              = 10;
const NEW_ACCOUNT_HELP_REPWD            = 11;
const NEW_ACCOUNT_HELP_NAME             = 12;
const NEW_ACCOUNT_HELP_SSNO             = 13;
const NEW_ACCOUNT_HELP_BIRTH            = 14;
const NEW_ACCOUNT_HELP_ZIPCODE          = 15;
const NEW_ACCOUNT_HELP_ADDRESS          = 16;
const NEW_ACCOUNT_HELP_PHONE            = 17;
const NEW_ACCOUNT_HELP_MOBILEPHONE      = 18;
const NEW_ACCOUNT_HELP_EMAIL            = 19;
const NEW_ACCOUNT_HELP_Q                = 20;
const NEW_ACCOUNT_HELP_A                = 21;
const NEW_ACCOUNT_WELL_DONE             = 22;
const ERROR_STR_LOGIN_1                 = 23;
const ERROR_STR_LOGIN_2                 = 24;
const ERROR_STR_LOGIN_3                 = 25;
const ERROR_STR_LOGIN_4                 = 26;
const ERROR_STR_NEW_ACCOUNT_1           = 27;
const ERROR_STR_NEW_ACCOUNT_2           = 28;
const ERROR_STR_NEW_ACCOUNT_3           = 29;
const ERROR_STR_NEW_ACCOUNT_4           = 30;
const ERROR_STR_NEW_ACCOUNT_5           = 31;
const ERROR_STR_NEW_ACCOUNT_6           = 32;
const ERROR_STR_NEW_ACCOUNT_7           = 33;
const ALRAM_CHARGE                      = 34;
const ALRAM_CHARGE_IP                   = 35;
const ALRAM_CHARGE_1                    = 36;
const ALRAM_CHARGE_2                    = 37;
const ALRAM_CHARGE_3                    = 38;
const CHANGE_PASSWORD                   = 39;
const CHANGE_PASSWORD_1                 = 40;
const CHANGE_PASSWORD_2                 = 41;
const CHANGE_PASSWORD_3                 = 42;
const CHANGE_PASSWORD_4                 = 43;
const ERROR_STR_SELECT_SERVER_1         = 44;
const ERROR_STR_SELECT_SERVER_2         = 45;
const ERROR_STR_NEWCHR_1                = 200;
const ERROR_STR_NEWCHR_2                = 201;
const ERROR_STR_NEWCHR_3                = 202;
const DELETE_CHARACTER_1                = 203;
const DELETE_CHARACTER_2                = 204;
const VERSION_NOT_MATCHED               = 205;
const ERROR_STR_START_GAME_1            = 206;
const ERROR_STR_DELCHR                  = 207;
const ERROR_STR_PATCH_1                 = 300;
const ERROR_STR_PATCH_2                 = 301;
const ERROR_STR_SERVER_CONNECTION       = 302;
const NOTICE_NOT_EXIST_INDEX            = 400;
const NOTICE_LAST_PAGE                  = 401;
const FATAL_ERROR_STR                   = 9999;
const SERVER_SELECT_TEST                = 10000;
//////////////////////////////////////////////////////////////////////////////////////////////////////


+/
/*******************************************************************************************************
        Login Procedure
*******************************************************************************************************/
const _LOGIN_SCREEN_WIDTH = 640;
const _LOGIN_SCREEN_HEIGHT = 480;


/******************************************************************************************************************
    #1. Progress States
*******************************************************************************************************************/
const PRG_CONNECT = -1;
const PRG_INTRO = 0;
const PRG_LOGIN = 1;
const PRG_NEW_ACCOUNT = 3;
const PRG_PATCH = 4;
const PRG_CHANGE_PASS = 5;
const PRG_SERVER_SELE = 6;
const PRG_TO_SELECT_CHR = 7;
const PRG_CHAR_SELE = 8;
const PRG_CREATE_CHAR = 9;
const PRG_PLAY_GAME = 10;

const PRG_SEL_TO_CREA = 30;
const PRG_CREA_TO_SEL = 31;
const PRG_SEL_TO_GAME = 32;

const PRG_PATCH_FILES = 77;
const PRG_NEED_ACCOUNT_CHANGE = 88;
const PRG_QUIT = 99;